const SAS1026 = {
  'type': 'object',
  'required': [
    'typeOfAppointment',
    'applicantInformation',
    'assignmentCommissions',
    'backgroundInformation',
    'fairCreditReporting',
    'formNumber',
    'formVersion'
  ],
  'properties': {
    'typeOfAppointment': {
      'allOf': [
        {
          '$ref': 'defsSchema.json#/definitions/typeOfAppointment'
        },
        {
          'properties': {
            'apptType': {
              'type': 'string',
              'description': 'Type of Appointment',
              'enum': [
                'Agency Principal/Owner',
                'Producer',
                'Registered Representative'
              ]
            },
            'referringBGA': {
              'type': 'string',
              'description': 'Referring BGA/GA'
            },
            'referringAgency': {
              'type': 'string',
              'description': 'Referring Agency'
            }
          },
          'anyOf': [
            {
              'required': ['apptType', 'referringBGA']
            },
            {
              'required': ['apptType', 'referringAgency']
            }
          ]
        }
      ]
    },
    'applicantInformation': {
      '$ref': 'defsSchema.json#/definitions/applicantInformation'
    },
    'entityLicensesRegistration': {
      'allOf': [
        {
          '$ref': 'defsSchema.json#/definitions/entityLicensesRegistration'
        },
        {
          'properties': {
            'npnNum': {
              'type': 'string',
              'description': 'NPN number'
            },
            'licSeries': {
              'type': 'array',
              'description': 'Check applicable series',
              'items': [
                {
                  'type': 'string',
                  'enum': ['6', '7', '65', '66']
                }
              ],
              'minItems': 0,
              'maxItems': 4
            }
          }
        }
      ]
    },
    'assignmentCommissions': {
      'type': 'boolean',
      'enum': [true, false]
    },
    'backgroundInformation': {
      '$ref': 'defsSchema.json#/definitions/backgroundInformation'
    },
    'fairCreditReporting': {
      '$ref': 'defsSchema.json#/definitions/fairCreditReporting'
    },
    'formNumber': {
      'type': 'string',
      'enum': ['SAS1026']
    },
    'formVersion': {
      'type': 'string'
    }
  }
};

module.exports = { SAS1026 };
